package com.sm.dao;

import java.util.List;

import com.github.pagehelper.Page;
import com.sm.model.Goods;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

public interface GoodsMapper {
    int deleteByPrimaryKey(Integer goodsId);

    Goods selectByPrimaryKey(Integer goodsId);

    int updateByPrimaryKeySelective(Goods record);

    int updateByPrimaryKey(Goods record);


    //通过一级类别id和二级类别id查询其包含的所有的商品
    List<Goods> selectGoodsBySort(@Param("firstSortId") Integer firstSortId, @Param("secondSortId") Integer secondSortId);

    /**
     * 圆梦超市中根据搜索内容查询搜索到的商品
     *
     * @param searchContent 搜索内容
     * @return
     */
    Page<Goods> selectGoodsByCont(@Param("searchContent") String searchContent);


    Page<Goods> listByTerm(@Param("firstSortId") Integer firstSortId, @Param("term") Integer term);
}
